<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="UTF-8">
<title>i-Test</title>
<link rel="stylesheet" type="text/css" href="styles/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="styles/themes/icon.css">
<link rel="stylesheet" type="text/css" href="styles/demo.css">
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.easyui.min.js"></script>

<script type="text/javascript">
	$(function() {
		$("#grid").datagrid({
			singleSelect : false,
			collapsible : false,
			url : 'resource/data.json',
			method : 'post',
			idField : 'id',
			fitColumns : 'true',
			treeField : 'name',
			toolbar : [ {
				text : '添加',
				iconCls : 'icon-add',
				handler : function() {
					$("#form").window('open');
				}
			},{
				text : '编辑',
				iconCls : 'icon-cut',
				handler : function() {
					
				}
			},{
				text : '删除',
				iconCls : 'icon-remove',
				handler : function() {
					var row = $("#grid").datagrid('getSelected');
					if(row!=null){
						$.messager.confirm('删除','您确定要删除该节点及其下所有子节点么？',function(is){
							if(is){
								$("#grid").datagrid('remove',row.id);
							}
						});
					}else{
						$.messager.alert('提示', '请先选中一行！')
					}
				}
			} ]
		});
			
	});
</script>
</head>

<body>
	<div id="form" class="easyui-window" title="表单" data-options="modal:true,closed:true,iconCls:'icon-print',collapsible:false" 
		style="width:400px;height:380px;padding:10px;">
		<div>
		 <form id="formView" method="post">
	    	<table cellpadding="5">
	    		<tr>
	    			<td>活动名称:</td>
	    			<td><input class="easyui-textbox" type="text" name="name" style="width:250px" data-options="required:true"></input></td>
	    		</tr>
	    		<tr>
	    			<td>期数:</td>
	    			<td><input class="easyui-textbox" type="text" name="email" style="width:250px" data-options="required:true,validType:'email'"></input></td>
	    		</tr>
	    		<tr>
	    			<td>信息:</td>
	    			<td><input class="easyui-textbox" type="text" name="subject" style="width:250px" data-options="required:true"></input></td>
	    		</tr>
	    		<tr>
	    			<td>总组数:</td>
	    			<td>
	    				<input class="easyui-textbox" type="text" name="subject" style="width:250px" data-options="required:true"></input>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td>创建人:</td>
	    			<td><input class="easyui-textbox" name="message" style="width:250px" data-options="multiline:true" style="height:60px"></input></td>
	    		</tr>
	    		<tr>
	    			<td>备注:</td>
	    			<td><input class="easyui-textbox" name="message" style="width:250px;height:100px" data-options="multiline:true" style="height:60px"></input></td>
	    		</tr>
	    	</table>
	    </form>
	    </div>
	    <div style="text-align:center;padding:5px">
	    	<a href="javascript:void(0)" style="width:60px" class="easyui-linkbutton" onclick="$('#formView').form('load','resource/form.json');">保存</a>
	    	<a href="javascript:void(0)" style="width:60px" class="easyui-linkbutton" onclick="$('#form').window('close')">关闭</a>
	    </div>
	</div>
		<div data-options="region:'center'" style="width:100%;height:70%;">
			<table class="easyui-treegrid" title="活动明细" id="grid" style="width:100%;height:100%;">
				<thead>
					<tr>
						<th data-options="field:'id',checkbox:true,halign:'center'">id</th>
						<th data-options="field:'activityCode',width:30,align:'left',halign:'center'">活动编码</th>
						<th data-options="field:'name',width:120,align:'center'">活动名称</th>
						<th data-options="field:'beginDate',width:90,align:'center'">开始时间</th>
						<th data-options="field:'weight',width:90,align:'center'">结束时间</th>
						<th data-options="field:'sex',width:50,halign:'center'">期数</th>
						<th data-options="field:'nation',width:120,align:'center'">信息</th>
						<th data-options="field:'tel',width:50,align:'center'">总组数</th>
						<th data-options="field:'1',width:60,align:'center'">创建人</th>
						<th data-options="field:'2',width:90,align:'center'">创建日期</th>
						<th data-options="field:'3',width:60,align:'center'">修改人</th>
						<th data-options="field:'4',width:90,align:'center'">修改日期</th>
						<th data-options="field:'5',width:160,align:'center'">备注</th>
					</tr>
					</tr>
				</thead>
			</table>
		</div>
	</div>
</body>
</html>
